using UnityEngine;
using System.Collections;

public class PlayerScript : MonoBehaviour {
	
	public const float MOVE_SPEED = 500.0f;
	// Use this for initialization
	void Start () 
	{
	
	}
	
	// Update is called once per frame
	void Update () 
	{
		//transform.Rotate(0, Input.GetAxis("Horizontal"), 0);
		Vector3 movement = new Vector3(Input.GetAxis("Horizontal") *MOVE_SPEED, 0, Input.GetAxis("Vertical") * MOVE_SPEED);	
		rigidbody.AddForce(movement);
		
		Vector3 newCamPosition = transform.position;
		newCamPosition.y = transform.localScale.y * 2;
		Camera.mainCamera.transform.position = newCamPosition;
		
		Quaternion newCamRotation = Quaternion.AngleAxis(Camera.mainCamera.transform.rotation.y * Input.GetAxis("Mouse X"), Vector3.up);
		//Camera.mainCamera.transform.rotation = newCamRotation;
		
		Camera.mainCamera.transform.Rotate(0, Input.GetAxis("Mouse X"), 0);
	}
}
